<button style="float: right" nz-button nzType="primary" nzSize="small" (click)="showAdd()">添加</button>
<br>
<nz-table [nzData]="dataList" [nzFrontPagination]="false" nzSize="small"
          [nzScroll]="{ x: '1150px', y: '300px' }">
  <thead>
  <tr>
    <th nzWidth="240px">文件名</th>
    <th nzWidth="360px">文件信息</th>
    <th nzWidth="120px">文件大小</th>
    <th nzWidth="180px">上传时间</th>
    <th nzWidth="120px" nzRight>操作</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of dataList">
    <td>{{ data.fileName }}</td>
    <td> {{ data.info }}</td>
    <td> {{ data.fileSize }}</td>

    <td>{{ data.uploadTime| date:'yyyy-MM-dd HH:mm:ss' }}</td>
    <td nzRight>
      <button disabled="{{allowDownload}}" (click)="download(data.id,data.fileName)" nz-button nzType="primary" nzSize="small">下载
      </button>
      &nbsp;
      <button nz-popconfirm nzPopconfirmTitle="确定删除该条数据吗？"
              (nzOnConfirm)="deleteConfirm(data.id)"
              (nzOnCancel)="cancel()" nz-button nzType="primary" nzSize="small">删除
      </button>
    </td>
  </tr>
  </tbody>
</nz-table>
<nz-pagination nzShowSizeChanger [(nzPageIndex)]="pageInfo.pageNum" [nzTotal]="pageInfo.total"
               [(nzPageSize)]="pageInfo.pageSize"
               [nzShowTotal]="totalTemplate" (nzPageIndexChange)="getList()"
               (nzPageSizeChange)="getList()"></nz-pagination>

<ng-template #totalTemplate>总共 {{ pageInfo.total }} 条</ng-template>

<nz-modal nzOkDisabled="{{nzOkDisabled}}" [(nzVisible)]="showAddFlag" nzTitle="添加文件" (nzOnCancel)="handleCancel()" (nzOnOk)="uploadFile()" >
  <ng-container *nzModalContent>
    <form nz-form>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired nzFor="email">文件</nz-form-label>
        <nz-form-control [nzSpan]="24">
          <nz-upload [(nzFileList)]="fileList" [nzBeforeUpload]="beforeUpload">
            <button nz-button>
              <span nz-icon nzType="upload"></span>
              请选择文件
            </button>
          </nz-upload>
        </nz-form-control>
      </nz-form-item>
      <nz-form-item>
        <nz-form-label [nzSpan]="4" nzRequired>文档说明</nz-form-label>
        <nz-form-control [nzSpan]="24">
          <textarea rows="3" nz-input [(ngModel)]="fileInfo.info" name="fileInfo.info"></textarea>
        </nz-form-control>
      </nz-form-item>
    </form>
  </ng-container>
</nz-modal>
